<template>
  <div class="header">
    <div class="headerin banxin">
      <div class="header-l"><img src="../assets/img/indexLogo.6f8ac4f0.png" alt=""></div>
      <div class="header-m">
        <ul>
          <li :class="{actice:$route.path==='/home'}" @click="$router.push('/home')">首页</li>
          <li :class="{actice:$route.path==='/goods'}" @click="$router.push('/goods')">全部商品</li>
          <li :class="{actice:$route.path==='/user'}" @click="$router.push('/user')">个人中心</li>
          <li :class="{actice:$route.path==='/order'}" @click="$router.push('/order')">我的订单</li>
          <li :class="{actice:$route.path==='/free'}" @click="$router.push('/free')">专属福利</li>
        </ul>
      </div>
      <div class="header-r">
        <input type="text" placeholder="输入关键字" v-model="userInput">
        <button @click="search()" class="btn"><img src="../assets/img/search.png" alt=""></button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      userInput:""
    }
  },
  methods:{
    search(){
      this.$router.push(`/goods?keyword=${this.userInput}`)
    }
  }
}
</script>

<style lang="less">
.header{
  width: 100%;
  height: 118px;
  .headerin{
    .header-l{
      float: left;
      img{
        margin-top: 14px;
      }
    }
    .header-m{
      float: left;
      ul{
        display: flex;
        justify-content: space-between;
        line-height: 118px;
        margin-left: 94px;
        width: 500px;
        // .actice{
        //   color: #0a328e;
        // }
      }
    }
    .actice{
          color: #0a328e;
        }
    .header-r{
      display: flex;      
      padding: 39px;
      // background-color: pink;
      float: right;
      width: 264px;
      height: 40px;
      input{
        height: 38px;
        width: 212px;
        border: 1px solid #DEDEDE;
        border-radius: 20px 0 0 20px;
        font-size: 12px;
        color: #999999;
        text-indent: 1em;
        outline: none;
      }
      .btn{
        width: 50px;
        height: 40px;
        border-radius: 0px 20px 20px 0;
        background-color: #0A328E;
      }
    }
  }
}
</style>